<template>
	<view class="flex-1 my-2 px-3">
		<web-view :src="url" :style="`width: ${myWidth}px;height: ${myHeight - 100}px;`" :webview-styles="webviewStyles" update-title="true"></web-view >
	</view>
</template>

<script>
	export default {
		name:"promote",
		computed:{
			myWidth() {
				return uni.getSystemInfoSync().windowWidth
			},
			myHeight() {
				return uni.getSystemInfoSync().screenHeight * (750 / uni.getSystemInfoSync().windowWidth)
			},
		},
		onLoad(option){
			console.log(option)
			this.url= option.adv_url
			// this.adv_name = 
			setTimeout(()=>{
				uni.setNavigationBarTitle({
				 title:option.adv_name
				})
			},2000)
		},
		mounted(){
			//获取webview页面    
			// var currentWebview = this.$mp.page.$getAppWebview().children()[0];
			// let that= this
			// currentWebview.addEventListener('load', function() {
			     
			//  }, false);
			
		},
		data() {
			return {
				webviewStyles: {
					progress: {
						color: '#ff5927'
					}
				},
				url:''
			}
		}
	}
</script>

<style>

</style>
